﻿namespace ExamV5.StudyInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmHeStudyLog : Page
    {
        protected Button butClose;
        protected GridView DataGridInfo;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        protected Label labTip;
        private PublicFun publicFun_0 = new PublicFun();
        private string string_0 = "B";

        private void method_0()
        {
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(string.Concat(new object[] { "select * from StudyLogInfo where Flag='A' and RubricType='", this.string_0, "' and RubricID=", this.int_0 }), selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "StudyLogInfo");
            this.DataGridInfo.DataSource = dataSet.Tables["StudyLogInfo"].DefaultView;
            this.DataGridInfo.DataBind();
            adapter.Dispose();
            dataSet.Dispose();
            selectConnection.Dispose();
            if (this.DataGridInfo.Rows.Count != 0)
            {
                this.labTip.Visible = false;
            }
            else
            {
                this.labTip.Visible = true;
                this.labTip.Text = "<br><br><font color=red>暂无他人公开的笔记内容</font><Br><br>";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            this.int_0 = Convert.ToInt32(base.Request["ID"].ToString());
            this.string_0 = this.publicFun_0.CheckString(base.Request["Flag"].ToString());
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString;
                if (!base.IsPostBack)
                {
                    if (!(this.publicFun_0.ReturnPaperData() != "Yes"))
                    {
                        if (this.int_0 != 0)
                        {
                            this.method_0();
                        }
                    }
                    else
                    {
                        base.Response.Write("<script>alert('此版本暂未授权,请与管理员联系！')</script>");
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

